<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>23. 正则操作DOM元素</title>
    </head>
    <body>
        <p>后盾人</p>
        <h1>
            houdunren.com
            </h1>
        <h2>hdcms.com</h2>
        <h3></h3>

    </body>
    <script>
        /*
        * .匹配除了换行或者结尾符号的所有内容
        * [\s\S] 匹配换行及所有内容
        **/
let body=document.body;
let reg=/<(h[1-6])>[\s\S]*<\/\1>/gi;
console.log(body.innerHTML.match(reg))
body.innerHTML=body.innerHTML.replace(reg,'')
    </script>
</html>
